<template>
  <div class="home">
    <div>
      数量：
      <span>{{ count }}</span>
      <button @click="tongbu(10)">{{ count }}</button>
      <button @click="yibu(10)">{{ num }}</button>
    </div>
    <div>double: {{ double }}</div>
  </div>
</template>

<script>
// @ is an alias to /src
import { mapState, mapGetters, mapMutations, mapActions } from "vuex";

export default {
  name: "Home",
  // computed: mapState(['count']),
  computed: {
    ...mapState(["count", "num"]),
    ...mapGetters(["double"])
  },
  data () {
    return {
      targetNum: 0
    };
  },

  methods: {
    ...mapMutations(["tongbu", "yibu"]),
    ...mapActions(["changeCount"])
  }
};
</script>
